#-------------------------------------------------------------------------------------------
# File:		timestamp.pm
# Author:	A.C. Verbeck
# Date:		October 9, 2013
# Version:	1
# Summary:	timestamp module
# Description:
#			This perl module returns a timestamp.
#
# $Id: timestamp.pm 243 2014-02-09 08:03:29Z ac.verbeck@gmail.com $
#-------------------------------------------------------------------------------------------
#	Copyright and Disclaimer Notice
#
#	Copyright (c) 2013-2014 A.C. Verbeck
#
#	This file is part of perl-base: AWK-like processing system
#
#	perl-base is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#
#	perl-base is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License
#	along with perl-base. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------------------
	package TimeStamp;

	use strict;
	use warnings;
	use Exporter;
	use vars qw($VERSION @ISA @EXPORT);

	$VERSION = '1.0.0';
	@ISA	= qw(Exporter);
	@EXPORT = qw(timestamp);

#-------------------------------------------------------------------------------------------
#
# Create timestamp string
# This subroutine creates a timestamp string.
# This subroutine does not take any arguments.
#
# Usage Example:
#   $ts=timestamp();
#
#-------------------------------------------------------------------------------------------
sub timestamp
{
	my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst, $datetime);
	
	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
	$datetime = sprintf("%04d-%02d-%02d %02d:%02d:%02d", 1900 + $year, $mon+1, $mday, $hour, $min, $sec);
	
	return($datetime);
}

#-------------------------------------------------------------------------------------------
#	return status for module load
#-------------------------------------------------------------------------------------------
	return 1;

#
# End: timestamp.pm
#
